﻿using System;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using Microsoft.VisualStudio.TestTools.UITest.Input;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Microsoft.VisualStudio.TestTools.UITesting.WindowsRuntimeControls;


namespace TestProjectWindowsPhone
{
    /// <summary>
    /// Summary description for CodedUITest3
    /// </summary>
    [CodedUITest]
    public class CodedUITest3
    {
        public CodedUITest3()
        {
        }

        [TestMethod]
        public void CodedUITestMethod3()
        {
            // Launch the app.
            XamlWindow myAppWindow = XamlWindow.Launch("{1D76A7E8-1C36-446E-A739-D5688CD4676D}:App:1d76a7e8-1c36-446e-a739-d5688cd4676d_1fadp56eckdn0!App");

            // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
            try
            {
                Gesture.Tap(this.UIMap.UIItemWindow.UINybrugerButton);

            }
            catch (Exception)
            {

            }
            
            this.UIMap.UIEvents4AllWindow.UIEmailTextBoxEdit.Text = "test@email.com";
            this.UIMap.UIEvents4AllWindow.UIPasswordPassBoxEdit.Text = "Test123";
            this.UIMap.UIEvents4AllWindow.UIConfirmPasswordPassBEdit.Text = "Test123";
            this.UIMap.UIEvents4AllWindow.UINameTextBoxEdit.Text = "Mads Madsen";
            this.UIMap.UIEvents4AllWindow.UIAddressTextBoxEdit.Text = "Vejnavn 12";
            this.UIMap.UIEvents4AllWindow.UIZipCodeTextBoxEdit.Text = "9000";
            this.UIMap.UIEvents4AllWindow.UICityTextBoxEdit.Text = "Aalborg";
            this.UIMap.UIEvents4AllWindow.UIPhoneTextBoxEdit.Text = "40204020";
            Gesture.Tap(this.UIMap.UIItemWindow.UIOpretButton);
            this.UIMap.LoginEmailPassword();
            Assert.IsTrue(true);
        }

        public UIMap UIMap
        {
            get
            {
                if ((this.map == null))
                {
                    this.map = new UIMap();
                }

                return this.map;
            }
        }

        private UIMap map;
    }
}
